<?php
/*
	监听电商客购买事件
	检查购买金额，满额即完成任务！
*/
defined('BY_JYA') or exit('error');
$time=$event['paytime'];
$fee=$event['price'];
$mid=$event['mid'];
//查询会员的充值满额的任务
$tasks=pdo_getall('jy_renwu_task_record',array('uniacid'=>$_SESSION['uniacid'],'mid'=>$mid,'tasktype'=>'order_full','stoptime >'=>time(),'finishtime >'=>'0'));
if($tasks){
	//修改任务状态为完成
	foreach($tasks as $task){
		if($task['task_demand'] <= $fee){
		pdo_update('jy_renwu_task_record',array('finishtime'=>$time),array('id'=>$task['id']));
		}
	}
}
